﻿<Window x:Class="ResourceBlender_Express.WinResourcesGrid"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:loc="clr-namespace:ResourceBlender_Express"
    loc:WindowService.EscapeClosesWindow="True"
    Title="View Resources" Height="470" Width="800" WindowStartupLocation="CenterOwner"
    Style="{StaticResource {x:Type Window}}" Icon="/ResourceBlender-Express;component/images/resourceblender.ico">
    <Window.CommandBindings>
        <CommandBinding Command="ApplicationCommands.Close" Executed="CloseWindow" />
        
        <CommandBinding Command="ApplicationCommands.New" Executed="AddElement" />
        <CommandBinding Command="loc:ResourceBlenderCommands.Edit" Executed="EditElement" CanExecute="CanExecuteEditElement" />
        <CommandBinding Command="loc:ResourceBlenderCommands.Delete" Executed="DeleteElement" CanExecute="CanExecuteDeleteElement" />
    </Window.CommandBindings>
    <Window.Resources>
        <loc:AlternatingRowSelector x:Key="AlternatingRowSelector" />
    </Window.Resources>
    <DockPanel>
        <Menu DockPanel.Dock="Top">
            <MenuItem Header="File">
                <MenuItem Header="Exit" Command="ApplicationCommands.Close" />
            </MenuItem>
        </Menu>
        <ToolBar DockPanel.Dock="Top" Height="58">
            <loc:ToolBarButton x:Name="btnAdd" Command="ApplicationCommands.New" Text="Add" Image="images/add_24.png" ToolTip="Add Element" />
            <loc:ToolBarButton x:Name="btnEdit" Command="loc:ResourceBlenderCommands.Edit" Text="Edit" Image="images/edit_24.png" ToolTip="Edit Element"/>
            <loc:ToolBarButton x:Name="btnDelete" Command="loc:ResourceBlenderCommands.Delete" Text="Delete" Image="images/delete_24.png" ToolTip="Delete Element" />
        </ToolBar>
        <Grid DockPanel.Dock="Top" Margin="6" >
            <ListView x:Name="lstGrid" ItemsSource="{Binding}" ItemContainerStyleSelector="{StaticResource AlternatingRowSelector}" MouseDoubleClick="lstGrid_MouseDoubleClick">
                <ListView.View>
                    <GridView x:Name="grdResources">
                        <GridViewColumn Header="Bundle" DisplayMemberBinding="{Binding Path=bundlename}" />
                        <GridViewColumn Header="Element" DisplayMemberBinding="{Binding Path=elementname}" />
                    </GridView>
                </ListView.View>
            </ListView>
        </Grid>
    </DockPanel>
</Window>
